<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>自动播放音频</title>
</head>
<body style="text-align:center;padding-top:100px;">
  <h2>欢迎！音频准备播放...</h2>
  <audio id="autoVoice" controls autoplay>
    <source src="test.mp3" type="audio/mpeg">
    你的浏览器不支持音频播放。
  </audio>
  <p>如果未自动播放，请点击上方播放键</p>
  <script>
    window.onload = function(){
      document.getElementById('autoVoice').play();
    };
  </script>
</body>
</html>
